from django.conf.urls.defaults import *
from django.conf import settings

urlpatterns = patterns('base.views',
    url(r'^$', 'index', name='index'),
    url(r'^can-not-access/$', 'can_not_access', name='can_not_access'),

) + patterns('base.views.school',
    url(r'^school/$', 'list', name='school_list'),
    url(r'^school/list/$', 'list', name='school_list'),
    url(r'^school/list/csv$', 'list_csv', name='school_list_csv'),
    url(r'^school/create/$', 'create', name='school_create'),
    url(r'^school/detail/(?P<school_id>\d+)/$', 'detail', name='school_detail'),
    url(r'^school/change/(?P<school_id>\d+)/$', 'change', name='school_change'),

) + patterns('base.views.booth',
    url(r'^booth/list/$', 'list', name='booth_list'),
    url(r'^booth/create/$', 'create', name='booth_create'),
    url(r'^booth/detail/(?P<booth_id>\d+)/$', 'detail', name='booth_detail'),
    url(r'^booth/change/(?P<booth_id>\d+)/$', 'change', name='booth_change'),

) + patterns('base.views.eteacher',
    url(r'^eteacher/list/$', 'list', name='eteacher_list'),
    url(r'^eteacher/create/$', 'create', name='eteacher_create'),
    url(r'^eteacher/detail/(?P<eteacher_id>\d+)/$', 'detail', name='eteacher_detail'),
    url(r'^eteacher/change/(?P<eteacher_id>\d+)/$', 'change', name='eteacher_change'),
    url(r'^eteacher/exchange/(?P<classproperty_id>\d+)/$', 'exchange', name='eteacher_exchange'),
    url(r'^eteacher/payment/(?P<eteacher_id>\d+)/$', 'payment', name='eteacher_payment'),
    url(r'^eteacher/schedule/(?P<eteacher_id>\d+)/$', 'schedule', name='eteacher_schedule'),

) + patterns('base.views.kteacher',
    url(r'^kteacher/list/$', 'list', name='kteacher_list'),
    url(r'^kteacher/create/$', 'create', name='kteacher_create'),
    url(r'^kteacher/detail/(?P<kteacher_id>\d+)/$', 'detail', name='kteacher_detail'),
    url(r'^kteacher/change/(?P<kteacher_id>\d+)/$', 'change', name='kteacher_change'),

) + patterns('base.views.timeslot',
    url(r'^timeslot/list/(?P<eteacher_id>\d+)/$', 'list', name='timeslot_list'),
    url(r'^timeslot/create/(?P<eteacher_id>\d+)/$', 'create', name='timeslot_create'),
    url(r'^timeslot/detail/(?P<timeslot_id>\d+)/$', 'detail', name='timeslot_detail'),
    url(r'^timeslot/change/(?P<timeslot_id>\d+)/$', 'change', name='timeslot_change'),

) + patterns('base.views.oneclass',
#    url(r'^class/$', 'list', name='school_list'),
#    url(r'^class/list/$', 'list', name='school_list'),
#    url(r'^class/create/$', 'create', name='school_create'),
    url(r'^class/create/$', 'create', name='oneclass_create'),
    url(r'^class/create/(?P<classproperty_id>\d+)/$', 'create_in_bulk', name='oneclass_create_in_bulk'),
    url(r'^class/detail/(?P<class_id>\d+)/$', 'detail', name='oneclass_detail'),
    url(r'^class/change/(?P<class_id>\d+)/$', 'change', name='oneclass_change'),

) + patterns('base.views.classproperty',
    url(r'^classproperty/list/(?P<school_id>\d+)/$', 'list', name='classproperty_list'),
    url(r'^classproperty/create/(?P<school_id>\d+)/$', 'create', name='classproperty_create'),
    url(r'^classproperty/detail/(?P<classproperty_id>\d+)/$', 'detail', name='classproperty_detail'),
    url(r'^classproperty/change/(?P<classproperty_id>\d+)/$', 'change', name='classproperty_change'),

) + patterns('base.views.schedule',
    url(r'^schedule/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', 'day_schedule', name='day_schedule'),
    url(r'^schedule/edit/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', 'day_schedule', name='day_schedule'),
    url(r'^schedule/week/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', 'week_schedule', name='week_schedule'),
    url(r'^schedule/set/booth/$', 'booth_set', name='set_booth'),
    url(r'^schedule/cancel/class/$', 'cancel_class', name='cancel_class'),

#) + patterns('base.views.invoice',
#    url(r'^invoice/$', 'create', name='invoice_create'),
#    url(r'^invoice/list/(?P<year>\d{4})/$', 'year_list', name='invoice_year_list'),
#    url(r'^invoice/list/(?P<year>\d{4})/(?P<month>\d{1,2})/$', 'month_list', name='invoice_month_list'),
#    url(r'^invoice/school/(?P<school_id>\d+)/(?P<year>\d{4})/$', 'school_list', name='invoice_school_list'),
#    url(r'^invoice/detail/(?P<invoice_id>\d+)/$', 'detail', name='invoice_detail'),
#    url(r'^invoice/(?P<year>\d{4})/(?P<month>\d{1,2})/school/(?P<school_id>\d+)/$', 'list', name='list'),

) + patterns('base.views.issue',
    url(r'^issue/list/$', 'list', name='issue_list'),
    url(r'^issue/create/$', 'create', name='issue_create'),
    url(r'^issue/detail/(?P<issue_id>\d+)/$', 'detail', name='issue_detail'),
    url(r'^issue/change/(?P<issue_id>\d+)/$', 'change', name='issue_change'),

) + patterns('base.views.temp_invoice',
    url(r'^invoice/$', 'create', name='invoice_create'),
    url(r'^invoice/list/(?P<year>\d{4})/$', 'year_list', name='invoice_year_list'),
    url(r'^invoice/list/csv/(?P<year>\d{4})/$', 'year_list_csv', name='invoice_year_list_csv'),
    url(r'^invoice/list/(?P<year>\d{4})/(?P<month>\d{1,2})/$', 'month_list', name='invoice_month_list'),
    url(r'^invoice/school/(?P<school_id>\d+)/(?P<year>\d{4})/$', 'school_list', name='invoice_school_list'),
    url(r'^invoice/detail/(?P<invoice_id>\d+)/$', 'detail', name='tempinvoice_detail'),
    url(r'^invoice/detail/csv/(?P<invoice_id>\d+)/$', 'detail_csv', name='tempinvoice_detail_csv'),
    url(r'^invoice/change/(?P<invoice_id>\d+)/$', 'change', name='invoice_change'),
    url(r'^invoice/delete/(?P<invoice_id>\d+)/$', 'delete', name='invoice_delete'),
#    url(r'^invoice/(?P<year>\d{4})/(?P<month>\d{1,2})/school/(?P<school_id>\d+)/$', 'list', name='list'),

) + patterns('base.views.staff',
    url(r'^staff/list/$', 'list', name='staff_list'),
    url(r'^staff/create/$', 'create', name='staff_create'),
    url(r'^staff/detail/(?P<staff_id>\d+)/$', 'detail', name='staff_detail'),
    url(r'^staff/change/(?P<staff_id>\d+)/$', 'change', name='staff_change'),
    url(r'^staff/delete/(?P<staff_id>\d+)/$', 'delete', name='staff_delete'),

) + patterns('',
    url(r'^static/(.*)$', 'django.views.static.serve', {
        'document_root': settings.BASE_STATIC_ROOT,
        }, name='base_static'),

)
